﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web;
using System.Threading;
using System.Globalization;
public class AQGlobal : Page
{

    public AQGlobal()
    {

    }

    protected override void InitializeCulture()
    {

        string lang = string.Empty;

        HttpCookie cookie = Request.Cookies["SelLang"];


        if (cookie != null && cookie.Value != null)
        {
            lang = cookie.Value;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);
        }
        else
        {
            cookie = new HttpCookie("SelLang");
            cookie.Value = "vi";
            cookie.Expires = DateTime.Now.AddYears(1);



            lang = cookie.Value;
            Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(lang);
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang);
            Response.Cookies.Add(cookie);
        }

        base.InitializeCulture();

    }
}
